package com.example.wx.controller;

import com.example.wx.modle.req.WxPublicAuthSuccessReqDTO;
import com.example.wx.other.ResponseDTO;
import com.example.wx.service.WxPublicAccountUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * 微信公众号-用户-员工绑定关系表
 *
 * @author ZhangBin
 * @date 2025-04-08 09:54:36
 * @Description:
 */
@RequestMapping("/accountUser")
@RestController
public class WxPublicAccountUserController {
    @Autowired
    private WxPublicAccountUserService wxPublicAccountUserService;

    /**
     * @author: ZhangBin
     * @date: 2025/4/8 18:10
     * @description: 微信授权成功保存openID
     */
    @PostMapping("/bind")
    public ResponseDTO<?> bind(@RequestBody @Valid WxPublicAuthSuccessReqDTO wxPublicAuthSuccessReqDTO){
        wxPublicAccountUserService.bind(wxPublicAuthSuccessReqDTO);
        return ResponseDTO.success();
    }
    
}
